<%-- 
    Document   : mensual
    Created on : 28/10/2013, 12:24:38 PM
    Author     : Alan Gonzalez
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<jsp:include page = "metadatos.jsp" flush = "True" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <table width="200" height="171" border="1">
            <tr>
                <td colspan="7"><div align="center"><c:out value="${principalCalendario.mes.nombreMes}"/></div>
                    <div align="center"></div>
                    <div align="center"></div>
                    <div align="center"></div>
                    <div align="center"></div>
                    <div align="center"></div>
                    <div align="center"></div></td>
            </tr>
            <tr>
                <td width="28"><div align="center">D</div></td>
                <td width="28"><div align="center">L</div></td>
                <td width="28"><div align="center">M</div></td>
                <td width="28"><div align="center">M</div></td>
                <td width="28"><div align="center">J</div></td>
                <td width="28"><div align="center">V</div></td>
                <td width="28"><div align="center">S</div></td>
            </tr>
            <c:set var="nDia" value="${0}"/>
            <c:if test="${principalCalendario.mes.diaInicio==1}">  <c:set var="nDia" value="${0}"/></c:if>

            <c:if test="${principalCalendario.mes.diaInicio==2}">
                <c:set var="nDia" value="${1}"/>
                <td></td>
            </c:if>

            <c:if test="${principalCalendario.mes.diaInicio==3}">
                <c:set var="nDia" value="${2}"/>
                <td></td>
                <td></td>
            </c:if>

            <c:if test="${principalCalendario.mes.diaInicio==4}">
                <c:set var="nDia" value="${3}"/>
                <td></td>
                <td></td>
                <td></td>
            </c:if>
            <c:if test="${principalCalendario.mes.diaInicio==5}">
                <c:set var="nDia" value="${4}"/>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </c:if>
            <c:if test="${principalCalendario.mes.diaInicio==6}">
                <c:set var="nDia" value="${5}"/>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </c:if>
            <c:if test="${principalCalendario.mes.diaInicio==7}">
                <c:set var="nDia" value="${5}"/>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </c:if>
            <c:forEach items="${principalCalendario.mes.dias}" var="dia">
                <c:if test="${nDia >= 7}">
                    <c:set var="nDia" value="${0}"/>
                </tr><tr>
                </c:if> 
                    <c:set var="nDia" value="${nDia+1}"/>
                    <td><c:out value="${dia.numeroDia}"/></td>
            </c:forEach>  
    </table>
</body>
</html>
